<#assign menu="eventComments">
<#assign submenu="eventComments_list">
<#include "/system/head.ftl">
<style type="text/css">
    .pagination {
        border-radius: 4px;
        display: inline-block;
        margin: 0;
        padding-left: 0;
    }
</style>
<!--main content start-->
<section id="main-content">
    <section class="wrapper">
        <!-- page start-->
        <section class="panel">
            <div class="tab-content">
                <div class="portlet box blue">

                    <div class="portlet-title">
                        <div class="caption">
                            <i class="fa fa-gift"></i>跟帖列表
                        </div>
                    </div>

                    <div class="portlet-body">

                        <div class="panel-body">
                            <div class="adv-table">
                                <div role="grid" class="dataTables_wrapper" id="hidden-table-info_wrapper">
                                    <table class="table table-striped table-advance table-hover">
                                        <thead>
                                        <tr>
                                            <th>#</th>
                                            <th>活动Id</th>
                                            <th>图片</th>
                                            <th>内容</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody role="alert" aria-live="polite" aria-relevant="all">
                                        <#list pageVo.list as e>
                                        <tr class="gradeA odd">
                                            <td>${e.id}</td>
                                            <td>${e.eventId}</td>
                                            <td>
                                                <#list e.imageList! as i>
                                                    <img src="${i.path}" width="50px" height="50px"/>
                                                </#list>
                                            </td>
                                            <td>${e.content!}</td>


                                            <td>

                                                <#if e.available==1>
                                                    <a class="js_takeOff_eventComments btn btn-success blue"
                                                       href="javascript:void(0);" eventCommentsId="${e.id}"
                                                       title="禁用">
                                                        禁用
                                                    </a>
                                                <#else >
                                                    <a class="js_check_eventComments  btn btn-success blue"
                                                       href="${basePath}/admin/eventComments/edit.htm?eventCommentsId=${e.id}">
                                                        查看
                                                    </a>

                                                </#if>
                                            </td>

                                        </tr>
                                        </#list>
                                        </tbody>
                                    </table>
                                    <div style="height: 30px;">
                                        <div class="pagination">${pageVo.pageNumHtml} </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </section>
        <!-- page end-->
    </section>
</section>
<!--main content end-->
<script>

    $(function () {
        var pageNum = "${p}";
        $('.js_takeOff_eventComments').click(function () {
            var eventCommentsId = $(this).attr('eventCommentsId');
            bootbox.dialog({
                message: "是否" + $(this).attr('title'),
                title: "提示",
                buttons: {
                    "delete": {
                        label: "确定",
                        className: "btn-success",
                        callback: function () {
                            $.get("${basePath}/admin/eventComments/takeOff.json", {"eventCommentsId": eventCommentsId}, function (data) {
                                window.location.reload();
                            });
                        }
                    },
                    "cancel": {
                        label: "取消",
                        className: "btn-primary",
                        callback: function () {

                        }
                    }
                }
            });
        });

        $('.js_check_eventComments').click(function () {
            var eventCommentsId = $(this).attr('eventCommentsId');
            bootbox.dialog({
                message: "是否" + $(this).attr('title'),
                title: "提示",
                buttons: {
                    "getOn": {
                        label: "确认",
                        className: "btn-success",
                        callback: function () {
                            $.get("${basePath}/admin/eventComments/getOn.json", {"eventCommentsId": eventCommentsId}, function (data) {
                                window.location.reload();
                            })
                        }
                    },
                    "cancel": {
                        label: "取消",
                        className: "btn-primary",
                        callback: funtion()

                    }
                }
            })
        })


        $(".js_appUser_check").change(function () {
            $.post("${basePath}/manage/appUser/check.json",
                    {"articleId": $(this).attr("appUserId"), check: $(this).val()},
                    function (data) {
                        if (data.result) {
                            window.location.href = "${basePath}/manage/appUser/list.htm?p=" + pageNum;
                        } else {
                            bootbox.alert(data.msg,
                                    function () {
                                        window.location.href = "${basePath}/manage/appUser/list.htm?p=" + pageNum;
                                    });
                        }
                    }, "json");
        });


        $("#push-select").val("${pushId!''}");
        $("#interest-select").val("${interestId!''}");
        $("#createAddress").val("${createAddress!''}");

    })

</script>
<#include "/system/foot.ftl">
